package com.ygk.bluepath.core.Presenter;

import com.ygk.bluepath.core.BPresenter;
import com.ygk.bluepath.core.Model.MainActivityModel;
import com.ygk.bluepath.core.View.MainActivity;
import com.ygk.bluepath.core.View.MainActivityView;

import org.json.JSONObject;

/**
 * Created by Handreace on 2016/7/11.
 */
public class MainActivityPresenter extends BPresenter {

    private MainActivityView mainActivityView;
    private MainActivityModel mainActivityModel;

    public MainActivityPresenter(MainActivity activity, MainActivityView mView) {
        super(activity, mView);
        this.mainActivityView = mView;
        this.mainActivityModel = new MainActivityModel(this);
        setModel(mainActivityModel);
    }

    @Override
    public void dealJsonObject(JSONObject result, String oid, Object extraStr) {
        // TODO Auto-generated method stub
        super.dealJsonObject(result, oid, extraStr);
        if (result != null) {
            String msg = result.optString("msg");
            tt(msg);
            int code = result.optInt("code");
            if (code == 0) {

            }
        }
    }

    public void freshView() {
        mainActivityView.freshView();
    }
}
